<?php
session_start();
require_once($_SERVER['DOCUMENT_ROOT']."/apps/class/transaction.php");
$action = $_GET['action'];
if(isset($_GET['description']))
$description = $_GET['description'];



if($action == "ADD"){
  $result = category::create_category_in_db($description);
}

if($action == "DELETE"){
  $account = new account($result);
}

if($action == "MODIFY"){
  $result = account::create_account_in_db($description,$currency);  
}

if($action == "LIST"){
  $accounts = new accounts('json');
  $result = $accounts->get_list_accounts();
  echo $result;
}

if($action == "SEARCH"){
  $description = $_GET['name_startsWith'];
  $result = categories::search_categories_in_db($description,'json');
  echo $result;
}






?>